<?php
$ArPlans = Dracosys::getSessionValue(SESSION_INTERFACE, 'PlanList');
$ArCities = Dracosys::getSessionValue(SESSION_INTERFACE, 'CityList');
?>
<h2>Busca de Cliente</h2>
<section id="CustomerSearch">
    <form method="post" action="<?=DRA_URL?>cliente/resultado-busca-cliente" name="FormBuscarCliente">
        <div class="toggleContainer" id="CustomerSearch_toggleSimple"><a href="#" class="toggle Up" rel="CustomerSearch_Simple">Busca Simples</a></div>
        <section id="CustomerSearch_Simple" class="section-update">
            <div class="out_txt big"><label for="CustomerSearch_IDCliente">Busca Por Id</label></div>
            <div class="inp_txt big"><input type="text" name="IDCliente" id="CustomerSearch_IDCliente" /></div>
        </section>
        <div class="toggleContainer" id="CustomerSearch_toggleSimple"><a href="#" class="toggle Down" rel="CustomerSearch_Document">Busca Por Documento</a></div>
        <section id="CustomerSearch_Document" class="section-update" style="display:none;">
            <div class="out_txt big"><label for="CustomerSearch_StCpf">Cpf</label></div>
            <div class="inp_txt big"><input type="text" name="StCpf" id="CustomerSearch_StCpf" class="Cpf" /></div>
            <div class="out_txt big"><label for="CustomerSearch_StCnpj">CNPJ</label></div>
            <div class="inp_txt big"><input type="text" name="StCnpj" id="CustomerSearch_StCnpj" class="Vat" /></div>
        </section>
        <div class="toggleContainer" id="CustomerSearch_toggleAdvanced"><a href="#" class="toggle Down" rel="CustomerSearch_Advanced">Busca Avançada</a></div>
        <section id="CustomerSearch_Advanced" class="section-update" style="display:none;">
        <div class="out_txt big"><label for="CustomerSearch_StNome">Nome</label></div>
        <div class="inp_txt big"><input type="text" name="StNome" id="CustomerSearch_StNome" /></div>
            <div class="out_txt big"><label for="CustomerSearch_Email">Email</label></div>
            <div class="inp_txt big"><input type="text" name="StEmail" id="CustomerSearch_StEmail" /></div>
            <div class="out_txt big">Status</div>
            <div class="inp_txt big">
                 <input type="radio" name="EnStatus" id="CustomerSearch_StatusAtivado" value="NORMAL" class="radio" />
                 <label for="CustomerSearch_StatusAtivado">Normal</label>
                 <input type="radio" name="EnStatus" id="CustomerSearch_StatusCancelado" value="CANCELADO" class="radio" />
                 <label for="CustomerSearch_StatusCancelado">Cancelado</label>
                 <input type="radio" name="EnStatus" id="CustomerSearch_StatusPreCancelado" value="PRE-CANCELADO" class="radio" />
                 <label for="CustomerSearch_StatusPreCancelado">Pré-Cancelado</label>
                 <input type="radio" name="EnStatus" id="CustomerSearch_StatusCongelado" value="CONGELADO" class="radio" />
                 <label for="CustomerSearch_StatusCongelado">Congelado</label>
                 <input type="radio" name="EnStatus" id="CustomerSearch_StatusAtrasado" value="ATRASADO" class="radio" />
                 <label for="CustomerSearch_StatusAtrasado">Atrasado</label>
            </div>
            <div class="out_txt big"><label for="CustomerSearch_StCidade">Cidade</label></div>
            <div class="inp_txt big">
                <select name="StCidade" id="CustomerSearch_StCidade">
                    <option value="">Selecione uma Cidade</option>
                    <?php foreach($ArCities as $ArCity): ?>
                        <option value="<?=$ArCity['StCidade']?>"><?=$ArCity['StCidade']?></option>
                    <?php endforeach; ?>
                </select>
            </div>
            <div class="out_txt big"><label for="CustomerSearch_IDPlano">Plano</label></div>
            <div class="inp_txt big">
                <select name="IDPlano" id="CustomerSearch_IDPlano">
                    <option value="">Selecione um Plano</option>
                    <?php foreach($ArPlans as $Plan): ?>
                        <option value="<?=$Plan->getIDPlano()?>"><?=$Plan->getStNome()?></option>
                    <?php endforeach; ?>
                </select>
            </div>
            <div class="out_txt big">Obedecer a todas as condições?</div>
            <div class="inp_txt big">
                 <input type="radio" name="FilterType" id="CustomerSearch_Sim" value="AND" class="radio" />
                 <label for="CustomerSearch_Sim">Sim</label>
                 <input type="radio" name="FilterType" id="CustomerSearch_Nao" value="OR" class="radio" checked="checked" />
                 <label for="CustomerSearch_Nao">Não</label>
            </div>
        </section>
        <div class="btn"><button class="v1">PESQUISAR</button></div>
    </form>
</section>